package com.lvjian.community.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lvjian.community.domain.User;
import com.lvjian.community.dao.UserRegisterMapper;
import com.lvjian.community.service.UserRegisterService;

/**
 * 用户注册Service实现类
 * 
 */
@Service
public class UserRegisterServiceImpl implements UserRegisterService {

    @Autowired
    private UserRegisterMapper userRegisterMapper;

    @Override
    public boolean isOrNotExistUserName(String username) {
        return userRegisterMapper.isOrNotExistUserName(username) == 0;
    }

    @Override
    public boolean isOrNotExistUserEmail(String email) {
        return userRegisterMapper.isOrNotExistUserEmail(email) == 0;
    }

    @Override
    public User insertUser(User user) {
        userRegisterMapper.insertUser(user);
        return user;
    }

}
